import config from 'config'
import httpFetch from 'share/httpFetch'
import errorMessage from 'share/errorMessage'
import { message } from 'antd';

let realmId = config.realmIds[location.host] || config.realmId;

export default {

  //获取表单配置
  getCustomForm(formOID){
    return httpFetch.get(`${config.baseUrl}/api/custom/forms/${formOID}`)
  },

  //获取表单默认值
  getFormValue(userOID, formOID, jobId) {
    return httpFetch.get(`${config.baseUrl}/api/custom/form/user/default/values?userOID=${userOID}&formOID=${formOID}&jobId=${jobId}`)
  },

  //获取额度默认值
  getQuotaValue(userOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/userInfo?userOID=${userOID}`)
  },

  //获取部门
  getDept(fullName) {
    return httpFetch.get(`${config.baseUrl}/api/users/v3/search?keyword=${fullName}`)
  },

  //判断是否是hr人员
  getCardOwnerValue(userOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/findCardList?userOID=${userOID}`)
  },

  //根据eid查找人员的oid
  getCardOwerEidValue(eid) {
    return httpFetch.get(`${config.baseUrl}/api/application/findUserOID?EID=${eid}`)
  },
  /**
   * 获取汇率
   * @param currency 要算汇率的币种
   * @param currencyDate (YYYY-MM-DD HH:mm:ss)
   * @param userOID 后台判断优先级2 如果有传userOID，则算的汇率是基于userOID所在公司的本位币的汇率 非必填字段
   * @param baseCode 后台判断优先级1 如果有传baseCode，则算的汇率是基于baseCode的汇率 非必填字段
   */
  getCurrencyRate(currency, currencyDate, userOID, baseCode) {
    let params = {
      currency,
      currencyDate,
      userOID,
      baseCode
    };
    return httpFetch.get(`${config.baseUrl}/api/company/standard/currency/get`, params)
  },

  //获取单据列表，formType：101（申请单）、102（报销单）、103（全部）
  getDocumentType(formType) {
    return httpFetch.get(`${config.baseUrl}/api/custom/forms/company/my/available/all/?formType=${formType}`)
  },

  //获取申请单列表
  getRequestList(page, size, applicationFormType, searchParams) {
    let url = `${config.baseUrl}/api/applications/v3/search?page=${page}&size=${size}`;
    let params = {
      withBudget: false,
      withCustomForm: false,
      withCustomFormProperty: false,
      withCustomFormValue: false,
      withParticipant: true,
      withUserInfo: true,
      applicationFormType
    };
    for(let param in params) {
      url += `&${param}=${params[param]}`
    }
    for(let searchName in searchParams) {
      if(searchName !== 'status') {
        url += searchParams[searchName] ? `&${searchName}=${searchParams[searchName]}` : ''
      } else {
        let temp = searchParams[searchName].match(/\d{4}/g);
        if(temp.length === 2) {
          url += `&status=${temp[0]}&rejectTypes=${temp[1]}`
        } else {
          temp.map(value => {
            url += `&status=${value}`;
            if (value === '1009') {
              url += `&closed=3`;//已停用的状态要多传个closed参数，为了和已通过状态区分
            }
          });
        }
      }
    }
    return httpFetch.get(url)
  },

  //获取申请单详情接口 (借款、差旅、费用、订票、京东申请单详情全部合并成了该接口)
  getRequestDetail(OID) {
    return httpFetch.get(`${config.baseUrl}/api/application/${OID}?roleType=TENANT`)
  },

  //获取商务应酬申请单是否隐藏参与人清单接口
  getIsHideParticipantsList(OID) {
    return httpFetch.get(`${config.baseUrl}/api/application/getIsHideParticipantsList?applicationOID=${OID}`)
  },

  //申请单含关闭信息的详情页
  getRequestCloseDetail(OID) {
    return httpFetch.get(`${config.baseUrl}/api/application/${OID}?withBudgetCloseStatus=true`)
  },

  //根据申请单OID及订票任务OID获取订票申请单详情(用于退改签审批页面)
  getBookerTaskRequestDetail(OID, bookTaskOID) {
    return httpFetch.get(`${config.baseUrl}/api/book/task/my/get/${OID}?travelOperationRecordOID=${bookTaskOID}`)
  },

  //申请单撤回
  recallRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/approvals/withdraw`, params)
  },

  //根据申请单OID获取借款单的还款进度
  getLoanRepayment(page, size, OID) {
    return httpFetch.get(`${config.baseUrl}/api/repayment/list?page=${page}&size=${size}&loanApplicationOid=${OID}`)
  },
  // 新增供应商
  addData(data) {
    return httpFetch.post(`${config.baseUrl}/supplier/api/ven/infobank/insert`,data)
  },
  // 新增银行卡
  addNewAccount (data) {
    return httpFetch.post(`${config.baseUrl}/supplier/api/ven/bank/insert`,data)
  },
  //根据表单OID获取申请单类型
  getFormType(OID) {
    return httpFetch.get(`${config.baseUrl}/api/custom/forms/${OID}`)
  },

  //获取收款人信息
  getVenMasterInfo(params) {
    return httpFetch.get(`${config.baseUrl}/supplier/api/ven/info/search`, params)
  },

  //根据收款人id获取收款账号
  //后端接口重构，通过bankId过滤正确的供应商与银行账户
  getAccountInfo(id,bankId) {
    if(bankId){
      return httpFetch.get(config.baseUrl + '/supplier/api/ven/infoBank?vendorInfoId=' + id + '&bankId='+ bankId);
    }else {
      return httpFetch.get(config.baseUrl + '/supplier/api/ven/infoBank?vendorInfoId=' + id);
    }
  },

  //根据收款人id获取收款账号
  searchAccountInfo(id, keyword) {
    return httpFetch.get(`${config.baseUrl}/supplier/api/ven/infoBank?vendorInfoId=${id}&keyword=${keyword}`);
  },

  //保存借款申请单
  saveLoanRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/loan/application/draft`, params)
  },

  //保存费用申请单
  saveExpenseRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/expense/applications/draft`, params)
  },

  //保存订票申请单
  saveBookerRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/booker/applications/draft`, params)
  },

  //保存京东申请单
  saveJDRequest(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/jingdong/order/applications/draft`, params).then(res => {
        resolve(res)
      }).catch(err => {
        errorMessage(err.response);
        reject(err)
      })
    })
  },

  //删除申请单
  deleteRequest(applicationOID) {
    return httpFetch.delete(`${config.baseUrl}/api/applications/all/${applicationOID}`)
  },

  //提交借款申请单
  submitLoanRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/loan/application/submit`, params)
  },

  //提交费用申请单
  submitExpenseRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/expense/applications/submit/v2`, params)
  },

  //提交订票申请单
  submitBookerRequest(params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/booker/applications/submit`, params)
  },

  //提交京东申请单
  submitJDRequest(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/jingdong/order/applications/custom/form/submit`, params).then(res => {
        resolve(res)
      }).catch(err => {
        errorMessage(err.response);
        reject(err)
      })
    })
  },

  //获取地点
  getDestinationByKeywork(keyword) {
    return httpFetch.get(`${config.baseUrl}/api/city/search/${keyword}?page=0&size=10&useType=FLIGHT`)
  },

  /**
   * 根据申请单OID获取行程信息
   * @param applicationOID 申请单OID
   * itineraryShowDetails 行程备注中展示的行程样式是否需要返回统一的格式 REMARK中itineraryDetails表示标准行程格式，itineraryShowDetails
   * withRequestDetail 是否查询差补行程的详细信息（每条差补行程的费用类型、参与人姓名、币种和金额）
   * withItemDetail 是否查询差补行程下的每个人的差补详情
   */
  getItineraryByApplicationOID(applicationOID) {
    let params = {
      applicationOID,
      // itineraryShowDetails: true,
      withRequestDetail: true,
      withItemDetail: true
    };
    return httpFetch.get(`${config.baseUrl}/api/travel/applications/itinerarys`, params)
  },

  /**
   * 根据申请单OID和最新版申请单OID获取行程信息
   * @param applicationOID 申请单OID
   * @param latestApplicationOID 最新版申请单OID
   * itineraryShowDetails 行程备注中展示的行程样式是否需要返回统一的格式
   * withRequestDetail 是否查询差补行程的详细信息（每条差补行程的费用类型、参与人姓名、币种和金额）
   * withItemDetail 是否查询差补行程下的每个人的差补详情
   */
  getLastItineraryByApplicationOID(applicationOID, latestApplicationOID) {
    let params = {
      applicationOID: applicationOID,
      newApplicationOID: latestApplicationOID,
      // itineraryShowDetails: true,
      withRequestDetail: true,
      withItemDetail: true
    };
    return httpFetch.get(`${config.baseUrl}/api/v2/travel/applications/itinerarys`, params)
  },

  //机票反馈信息是否合适
  handleBoardingConfirmation(applicationOID, comment, flag, travelOrderOIDs) {
    let url = `${config.baseUrl}/api/travel/operation/confirm?applicationOID=${applicationOID}&flag=${flag}&travelOrderOIDs=${travelOrderOIDs}`;
    comment && (url += `&comment=${comment}`);
    return httpFetch.get(url)
  },

  //判断审批通过的差旅申请单能否进行更改操作
  judgeEnableChange(applicationOID) {
    return httpFetch.get(`${config.baseUrl}/api/travel/application/change/enable?lastApplicationOID=${applicationOID}`)
  },

  //差旅申请单更改
  handleApplicationUpload(applicationOID, params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/applications/draft/${applicationOID}`, params)
  },

  //订票申请单退票
  submitRefundApplication(params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/orders/refund/apply`, params)
  },

  //订票申请单改签
  submitEndorseApplication(params) {
    return httpFetch.post(`${config.baseUrl}/api/travel/orders/endorse/apply`, params)
  },

  //打印差旅申请单
  printTravelApplication(applicationOID) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/api/travel/application/generate/pdf/${applicationOID}`).then(res => {
        resolve(res)
      }).catch(err => {
        errorMessage(err.response);
        reject(err)
      })
    })
  },

  //打印借款申请单
  printLoanApplication(applicationOID) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/api/loan/application/generate/pdf/${applicationOID}`).then(res => {
        resolve(res)
      }).catch(err => {
        errorMessage(err.response);
        reject(err)
      })
    })
  },

  //打印费用申请单
  printExpenseApplication(applicationOID) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/api/expense/application/generate/pdf/${applicationOID}`).then(res => {
        resolve(res)
      }).catch(err => {
        errorMessage(err.response);
        reject(err)
      })
    })
  },

  //申请单停用
  expireApplication(applicationOID, participantOID) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/applications/close?applicationOID=${applicationOID}&participantOID=${participantOID}`).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },

  //申请单重新启用
  restartApplication(applicationOID, participantOID, closeDay) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/applications/restart?applicationOID=${applicationOID}&participantOID=${participantOID}&closeDay=${closeDay}`).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },

  //获取借款单的默认关联申请单
  getLoanDefaultRelativeApplication(formOID, applicantOID) {
    let params = {
      "withTravelApplication": false,
      "withExpenseApplication": false,
      "withBookingApplication": false,
      "withLoanApplication": false,
      "withUserInfo": true,
      "withParticipant": true,
      "withCustomFormValue": true
    };
    return httpFetch.post(`${config.baseUrl}/api/loan/reference/my/application/default?formOID=${formOID}&applicantOID=${applicantOID}`, params)
  },

  //免打印查询
  searchPrintFree(tenantId,params) {
    return httpFetch.post(`${config.baseUrl}/config/api/config/hit/EXPENSE_REPORT_PRINT_FREE?tenantId=${tenantId}`, params);
  },

  //获取收款方
  getPayee(page, size, keyword) {
    return httpFetch.get(`${config.baseUrl}/api/search/users/entire?page=${page}&size=${size}&keyword=${encodeURIComponent(keyword)}`)
  },

  //获取无代理关系的单据列表，formType：101（申请单）、102（报销单）、103（全部）
  //传userOID则获取该用户下可代理的单据
  //isAll为true表示所有岗位 不传和false表示默认岗位
  getMyDocumentType(formType, userOID, isAll, applicationFormType) {
    return httpFetch.get(`${config.baseUrl}/api/custom/forms/my/available`, {
      formType: formType,
      userOID: userOID,
      isAll,
      applicationFormType
    });
  },

  //获取员工
  getUser(params) {
    return httpFetch.get(`${config.baseUrl}/api/users/v3/search`, params)
  },

  //设置转交人
  /**
   *
   * @param applicationOID 申请单oid
   * @param userOID 转交人oid
   * @returns {AxiosPromise|*}
   */
  setTransfer(applicationOID, userOID) {
    return httpFetch.post(`${config.baseUrl}/api/application/deliver?applicationOID=${applicationOID}&userOID=${userOID}`)
  },

  //关闭申请单上的分摊行
  setCloseExpense(params) {
    return httpFetch.post(`${config.baseUrl}/api/application/budget/close`, params)
  },

  //查询申请单上的预算明细
  getApplicationBudgetList(applicationOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/form/expense/budget?applicationOID=${applicationOID}`);
  },

  //校验是否有权限创建借款单
  checkAutoLoan(applicantOID, formOID, jobId) {
    return httpFetch.get(`${config.baseUrl}/api/applicant/form/submit?applicantOID=${applicantOID}&formOID=${formOID}&jobId=${jobId}`);
  },

  //校验是否有权限创建报销单
  /**
   *
   * @param applicantOID 报销单申请人oid
   * @param applicationOID 申请单oid
   */
  checkExpenseReport(applicantOID, applicationOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/check/create/report?applicantOID=${applicantOID}&applicationOID=${applicationOID}`);
  },

  //查询是否有代理的表单，formType：101（申请单）、102（报销单）、103（全部）
  isShowProxy(formType) {
    return httpFetch.get(`${config.baseUrl}/api/custom/forms/my/proxy/customForm`, {
      formType: formType
    });
  },

  //查询我的制单被代理人
  getProxyApplicantList(formType) {
    return httpFetch.get(`${config.baseUrl}/api/bill/proxy/query/my/principals?formType=${formType}`);
  },

  //获取预算执行情况列表
  getBudgetExplain(params) {
    return httpFetch.get(`${config.baseUrl}/api/application/budget/explain/info/v2/count`, params);
  },

  //获取第三方返回信息
  getThirdPartyInfo(applicationOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/third/info?applicationOID=${applicationOID}`);
  },

  //判断当前租户下存在成本中心项权限分配的数据(表单中成本中心控件是否需要清空)
  checkCostCenterNeedEmpty() {
    return httpFetch.get(`${config.baseUrl}/api/cost/center/by/tenant/visible`)
  },

  //获取该申请单被关联于哪些单据
  getRelatedList(applicationOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/refer/documents?applicationOID=${applicationOID}`);
  },

  /**
   * 获取申请人的信用分
   * @returns {*}
   */
  getUserCredit(applicantOID, jobId){
    let params = {userOID: applicantOID, jobId};
    return httpFetch.get(`${config.baseUrl}/api/credit/user/info`,params);
  },
  /**
   * 获取审批单下所有订单（机酒）
   * @param params
   * @returns {*}
   */
  getAllOrderList(params){
    return httpFetch.get(`${config.baseUrl}/open/order/api/v2/ticket/getOrderList?realmId=${realmId}`, params);
  },
  /**
   * 根据工会公司的companyOId去获取公司所属的工会的数据
   * @param {String} companyOId
   */
  getCostcenterByCompany(companyOId) {
    return new Promise((resolve) => {
      resolve(httpFetch.get(`${config.baseUrl}/api/costcenter/item?companyOId=${companyOId}`));
    });
  },
  /**
   * 查询申请单中礼品行
   * @param applicationId 申请单id
   * @param formType 礼品:1.礼品申请2.礼品卡3.BOG
   */
  getGiftRequestDetail(applicationId, formType) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/api/gift/line/query/by/application/id?applicationId=${applicationId}&formType=${formType}&isFinance=false&roleType=TENANT`).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 新增申请单中礼品行
   @param params
   * @returns {*}
   */
  giftRequestDetailTableAdd(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/gift/line?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 编辑申请单中礼品行
   @param params
   * @returns {*}
   */
  giftRequestDetailTableEdit(params) {
    return new Promise((resolve, reject) => {
      httpFetch.put(`${config.baseUrl}/api/gift/line?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 删除申请单中礼品行
   *@param id  礼品行id
   */
  giftRequestDetailTableDelete(id) {
    return new Promise((resolve, reject) => {
      httpFetch.delete(`${config.baseUrl}/api/gift/line?id=${id}&roleType=TENANT`).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 礼品卡类型Oid
   *  @param formType 礼品:1.礼品申请2.礼品卡3.BOG7.现金券
   */
  getGiftCardType (formType,isElectronic) {
    if(isElectronic == '002' || isElectronic == '电子卡券'  ){
      return httpFetch.get(`${config.baseUrl}/api/gift/enumerations?formType=${formType}&roleType=TENANT&isElectronic=1`)
    }else{
      return httpFetch.get(`${config.baseUrl}/api/gift/enumerations?formType=${formType}&roleType=TENANT`)
    }
  },
  /**
   * 礼品卡类型值列表
   *  @param customEnumerationOID 值列表Oid
   */
  getGiftCardTypeList (customEnumerationOID) {
    return httpFetch.get(`${config.baseUrl}/api/custom/enumerations/${customEnumerationOID}?roleType=TENANT`)
  },
  /**
   * 接收人信息列表
   *  @param applicationId  申请单id
   */
  getReceiverInfoList (applicationId) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/api/gift/receiver/query/by/application/id?applicationId=${applicationId}&isFinance=false&roleType=TENANT`).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 增加接收人信息
   * @param params
   * @returns {*}
   */
  receiverInfoListAdd (params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/gift/receiver?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        try {
          if(e.response.data.fieldErrors){
            message.error(`${e.response.data.fieldErrors[0].message}`)
            reject(e)
          }else{
            errorMessage(e.response);
            reject(e)
          }
        }catch (err) {
          reject(e)
        }
      })
    })
  },
  /**
   * 编辑接收人信息
   @param params
   * @returns {*}
   */
  receiverInfoListEdit(params) {
    return new Promise((resolve, reject) => {
      httpFetch.put(`${config.baseUrl}/api/gift/receiver?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 删除接收人信息
   *  @param applicationId  申请单id
   */
  receiverInfoListDelete(id) {
    return new Promise((resolve, reject) => {
      httpFetch.delete(`${config.baseUrl}/api/gift/receiver?id=${id}&roleType=TENANT`).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 礼品申请保存为草稿
   *  @param params
   */
  giftRequestDetailTableSave(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/gift/applications/draft?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
  * 礼品申请提交
  *  @param params
  */
  giftRequestDetailTableSubmit(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/gift/applications/submit/v2?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 预约领取
   */
  appointmentCollection(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/gift/applications/receive/v2?roleType=TENANT`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 通过
  */
  appointmentCollectionPass(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/approvals/pass`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 撤回
   */
  giftApplicationReturn(params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/approvals/withdraw`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },
  /**
   * 下载模板
   */
  downloadTemplate (downloadMethod, downloadUrl, params) {
    return new Promise((resolve, reject) => {
      httpFetch[downloadMethod](`${config.baseUrl}${downloadUrl}`, params, {}, {responseType: 'arraybuffer'})
        .then(res => {
          resolve(res);
        })
        .catch(err => {
          errorMessage(err.response);
          reject(err);
        })
    })
  },

  /**
   * 关闭
   */
  closeApplications (params) {
    return new Promise((resolve, reject) => {
      httpFetch.post(`${config.baseUrl}/api/gift/applications/close?applicationOID=${params.applicationOID}&participantOID=${params.participantOID}`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },

  // 获取表单数据
  getFormsProxy (params) {
    return new Promise((resolve, reject) => {
      httpFetch.get(`${config.baseUrl}/api/custom/forms/proxy`, params).then(res => {
        resolve(res)
      }).catch(e => {
        errorMessage(e.response);
        reject(e)
      })
    })
  },

  //公务卡注销单判断是否是hr人员
  getUserIsHr(userOID) {
    return httpFetch.get(`${config.baseUrl}/api/application/getUserIsHr?userOID=${userOID}`)
  },

  // 获取司机车牌号
  getDirverCarNumber(id) {
    return httpFetch.get(`${config.baseUrl}/api/car/getCarByApprovalEmployeeID?employeeID=${id}`)
  },

  // 获取代第三方报销单据类型值列表
  getThirdTypeList(customEnumerationOID, applicantOID) {
    return httpFetch.get(`${config.baseUrl}/api/custom/enumerations/${customEnumerationOID}/items/v2?page=0&size=10&roleType=TENANT&applicantOID=${applicantOID}`)
  },

  // 礼品申请单编辑表头删除礼品行和接收人
  deleteApplicationGift(applicationId) {
    return httpFetch.delete(`${config.baseUrl}/api/gift/applications/remove/${applicationId}`)
  },

  // 代理申请单获取 代理日期叠加的信息 文档-1217
  getProxyRuleHint(mainOid, minorOid, formCode) {
    return httpFetch.get(`${config.baseUrl}/api/bill/proxy/rules/hint/${mainOid}/${minorOid}?formCode=${formCode}`)
  }
}
